#include "linklist.h"
#include "gtest/gtest.h"
#include <iostream>

// setuptestcase fixture
// setup everycase

class DsLinkListTest : public ::testing::Test {
  protected:
    virtual void SetUp() { std::cout << "setup executor" << std::endl; }
    virtual void TearDown() { std::cout << "teardown executor" << std::endl; }
    static void  SetUpTestCase() { std::cout << "setup by case" << std::endl; }
    static void  TearDownTestCase()
    {
        std::cout << "teardown by case" << std::endl;
    }
};

TEST_F(DsLinkListTest, LinkList_appendNode)
{
    STATUS    ret;
    LinkList *list = nullptr;

    ret = NewLinkList(&list);
    ASSERT_EQ(ret, RET_STATUS_OK);
    ASSERT_NE(list, nullptr);

    LinkList node = {0};
    node.next     = nullptr;
    node.data     = 89;

    ret = append(list, &node);
    ASSERT_EQ(ret, RET_STATUS_OK);

    PrintLinkList(list);

    append(list, &node);
    ASSERT_EQ(ret, RET_STATUS_OK);

    PrintLinkList(list);

    ret = freeLinkList(list);
    ASSERT_EQ(ret, RET_STATUS_OK);

    EXPECT_EQ(1, 1);
}
